<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePlayerSourcesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('player_sources', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->tinyInteger('type_id')->unsigned()->index()->comment('关联播放类型');
            $table->boolean('is_free')->default(false)->comment('是否可免费观看');
            $table->boolean('is_vip_free')->default(true)->comment('VIP 是否可以免费播放');
            $table->string('content')->nullable()->comment('描述');
            $table->string('url')->comment('播放地址');
            $table->unsignedBigInteger('movie_id')->index()->comment('关联电影模型');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('player_sources');
    }
}
